package com.zhanglingfei.yuekaoshop.entity;

import lombok.Data;

import java.io.Serializable;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author Shichao.Lu
 * 商品分类和品牌的中间表，两者是多对多关系
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_category_brand")
@DynamicInsert
@DynamicUpdate
public class CategoryBrand implements Serializable {

	/**
	 * 商品类目id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "category_id")
	private Long categoryId;

	/**
	 * 品牌id
	 */
	@Column(name = "brand_id")
	private Long brandId;
}
